package com.rs.processor;

import com.rs.entity.basic.DeviceStatus;
import com.rs.entity.enums.VehicleStatus;

/**
 * 车辆状态处理器
 *
 * @author zhouwz
 * @date 2020/9/17 13:36
 */
public class VehicleStatusProcessor {

    /**
     * 充电到可用处理
     *
     * @param vehicleStatus 车辆实时状态
     */
    public static void chargeToAvailableHandler(DeviceStatus vehicleStatus) {
        int fixedChargeAvailablePower = 80;
        if (vehicleStatus != null && vehicleStatus.getPower().intValue() > fixedChargeAvailablePower && (VehicleStatus.CHARGE.getCode().equals(vehicleStatus.getStatus()))) {
            vehicleStatus.setStatus(VehicleStatus.IDLE.getCode());
        }
    }
}
